com.highdeal.pnr.hci
Class RateComponentModel

java.lang.Object
  extended by com.highdeal.pnr.hci.RateComponentModel
All Implemented Interfaces:
XMLMarshallable, ContextualNode
Direct Known Subclasses:
ChargeModel, DefaultChargeActionModel, ExternalChargeActionModel, MacroComponentModel, OutPropertyUpdateComponentModel, PreTableComponentModel, PreTierTableComponentModel

public abstract class RateComponentModel
extends java.lang.Object
implements ContextualNode, XMLMarshallable

Abstract representation of a rate component.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="component">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="property" minOccurs="0" maxOccurs="unbounded"/>
       <xs:element ref="component" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
    <xs:attribute name="name" type="xs:string"/>
    <xs:attribute name="type" type="xs:string"/>
    <xs:attribute name="description" type="xs:string"/>
   </xs:complexType>
  </xs:element>


Field Summary
protected  java.util.Vector<RateComponentModel> children
          Component contained by this component
protected  java.lang.String description
          The component description.
protected  java.lang.String name
          The component name.
protected  ContextualNode parent
          The parent of this component.
 
Constructor Summary
RateComponentModel()
          Builds an empty RateComponentModel.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String name, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
abstract  boolean checkValidity()
          Returns true if the component is valid.
 RateComponentModel getChildAt(int index)
          Gets a child.
 int getChildCount()
          Gets the child count.
 java.util.Vector<RateComponentModel> getChildren()
          Gets the children.
 RatingContextDescription getContext(ContextualNode child)
          Gets the context description for the specified child; The context description contains all the context properties.
 java.lang.String getDescription()
          Gets the description.
abstract  int getMaxChildCount()
          Gets the maximum child count.
 java.lang.String getName()
          Gets the name.
 ContextualNode getParent()
           
 RatingContextDescription inheritedContext()
          Gets the inherited context; The context description contains all the context properties.
 boolean isRemoveChildAllowed(int index)
          Test if removing a child at an index is allowed.
 boolean isSetChildAllowed(int index)
          Tests if setting a child at an index is allowed.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
protected  void marshallChildren(XMLOutputter output)
          INTERNAL USE .
 void remove()
          Clears the component to remove it.
 void removeChild(int index)
          Removes a child.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setChild(int index, RateComponentModel component)
          Sets a child.
protected  void setChild(int index, RateComponentModel component, boolean checkMaxChildCount)
           
 void setChildren(java.util.Vector<RateComponentModel> children)
          Sets the children.
 void setDescription(java.lang.String description)
          Sets the description.
 void setName(java.lang.String name)
          Sets the name.
 void setParent(ContextualNode node)
          Sets the parent node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected ContextualNode parent
The parent of this component.


children

protected java.util.Vector<RateComponentModel> children
Component contained by this component


name

protected java.lang.String name
The component name.


description

protected java.lang.String description
The component description.

Constructor Detail

RateComponentModel

public RateComponentModel()
Builds an empty RateComponentModel.

Method Detail

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name - the name.

getName

public java.lang.String getName()
Gets the name.

Returns:
the name.

setDescription

public void setDescription(java.lang.String description)
Sets the description.

Parameters:
description - the description.

getDescription

public java.lang.String getDescription()
Gets the description.

Returns:
the description.

getChildCount

public int getChildCount()
Gets the child count.

Returns:
the child count.

getChildAt

public RateComponentModel getChildAt(int index)
                              throws java.lang.IndexOutOfBoundsException
Gets a child.

Parameters:
index - the index of the desired child.
Returns:
the child positionned at the index or null if invalid index.
Throws:
java.lang.IndexOutOfBoundsException

getMaxChildCount

public abstract int getMaxChildCount()
Gets the maximum child count.

Returns:
the maximum child count.

checkValidity

public abstract boolean checkValidity()
Returns true if the component is valid.

Returns:
true if the component is valid, false otherwise.

setChild

public void setChild(int index,
                     RateComponentModel component)
              throws java.lang.IndexOutOfBoundsException
Sets a child. Child is added at the end if index is higher than child count.

Parameters:
index - the index where to place the child.
component - the child component.
Throws:
java.lang.IndexOutOfBoundsException

removeChild

public void removeChild(int index)
                 throws java.lang.IndexOutOfBoundsException
Removes a child.

Parameters:
index - the index of the child to remove.
Throws:
java.lang.IndexOutOfBoundsException

remove

public void remove()
Clears the component to remove it.


isSetChildAllowed

public boolean isSetChildAllowed(int index)
                          throws java.lang.IndexOutOfBoundsException
Tests if setting a child at an index is allowed.

Parameters:
index - the index of the desired child.
Returns:
true if index correspond to a null child, false otherwise.
Throws:
java.lang.IndexOutOfBoundsException

isRemoveChildAllowed

public boolean isRemoveChildAllowed(int index)
                             throws java.lang.IndexOutOfBoundsException
Test if removing a child at an index is allowed.

Parameters:
index - the index of the desired child.
Returns:
true if index corresponds to a valid child, false otherwise.
Throws:
java.lang.IndexOutOfBoundsException

setChildren

public void setChildren(java.util.Vector<RateComponentModel> children)
Sets the children.

Parameters:
children - a Vector of RateComponentModel representing the children.

getChildren

public java.util.Vector<RateComponentModel> getChildren()
Gets the children.

Returns:
a Vector of RateComponentModel representing the children.

setParent

public void setParent(ContextualNode node)
Description copied from interface: ContextualNode
Sets the parent node

Specified by:
setParent in interface ContextualNode
Parameters:
node - The parent node

getParent

public ContextualNode getParent()

getContext

public RatingContextDescription getContext(ContextualNode child)
Description copied from interface: ContextualNode
Gets the context description for the specified child; The context description contains all the context properties.

Specified by:
getContext in interface ContextualNode
Parameters:
child - The child node
Returns:
The context description

inheritedContext

public RatingContextDescription inheritedContext()
Description copied from interface: ContextualNode
Gets the inherited context; The context description contains all the context properties.

Specified by:
inheritedContext in interface ContextualNode
Returns:
The inherited context

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the element being processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current element

addChild

public void addChild(java.lang.String name,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the object, the child representing the marshallable object which must be added to the element.

Specified by:
addChild in interface XMLMarshallable
Parameters:
name - The name of tag for the child
child - The child to be added

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - The character data to be added

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

marshallChildren

protected void marshallChildren(XMLOutputter output)
INTERNAL USE .


setChild

protected void setChild(int index,
                        RateComponentModel component,
                        boolean checkMaxChildCount)
                 throws java.lang.IndexOutOfBoundsException
Throws:
java.lang.IndexOutOfBoundsException

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)